-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: backend for sending event reminders 📆 #524
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @imnotrafa! I really like how you implemented the algorithm within this function-it's logical and easy to follow. Left a few comments, let me know if you have any questions!
@@ -0,0 +1,40 @@ | |||
import { db } from '@oyster/db'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this file to send-event-reminder
to stay consistent with the naming pattern of the other files in this directory
}, | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As part of this PR, let's also create the template for the email-specifically event-reminder.tsx
which can be placed in packages/email-templates/emails/application-created.tsx
. Don't worry too much about all the wording details, but do try to have a general structure similar to the other emails in the emails
directory.
This will also requiring adding the reference to the new email template in the right places throughout packages/core/src/modules/notification/use-cases/send-email.ts
.
//Must change the name of the email template being used based on the prupose of the function | ||
//TODO: create an email tenplate for event reminders | ||
unregisteredStudents.forEach((student) => { | ||
sendEmail({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might face an issue here. Since we're sending so many emails, we'll need to make sure we adhere to any email rate limits imposed by Postmark (which is what we use to send emails). Doing some research gives more precise limits.
However, the logic for sending email batches adhering to rate limits should be done as a worker separate from this function, so we can have this done as part of a separate issue. No worries if you don't want to take this on right now.
I'll also tag @ramiAbdou in case he has any more feedback regarding this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can take on this new issue right away if possible.
Description ✏️
Closes #477
Type of Change 🐞
Checklist ✅